<template lang="pug">
  .zgplugin-date.zgplugin-empty(v-if="(!exist || !show)&&editor")
    svg-icon.empty-icon(icon-class="组件日期")
  .zgplugin-date(v-show="show" v-else-if="exist")
    normal-date-render(v-if="!config.isFilter" :config="config" :readonlyMain="readonlyMain" :editor="editor" ref="normalDate" :scope="scope")
    filter-date-render(v-if="config.isFilter" :config="config" :editor="editor" ref="filterDate")
</template>
<script>
import inputCommon from '../../../../mixin/inputCommon'

import normalDateRender from './normalDateRender'
import filterDateRender from './filterDateRender'

export default {
  name: 'dateRender',
  components: { normalDateRender, filterDateRender },
  mixins: [inputCommon],
  props: ['config', 'editor', 'scope','readonlyMain'],
  inject: ['rootForm'],
  data() {
    return {
      default: undefined
    }
  },
  methods: {
    commit() {
      this.$refs.filterDate.commit()
    },
    validate() {
      return this.$refs.normalDate.validate()
    }
  },
  created() {
  }
}
</script>
<style lang="scss">
  .zgplugin-date {
    margin-top: 16px;
    .el-form-item{
      margin-bottom: 0 !important;
    }

    .el-input__inner {
      height: 34px;
    }
  }
</style>
